package com.bos.util;

import org.apache.log4j.MDC;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.io.IOException;


public class ResFilter implements Filter {


    private final static double DEFAULT_USERID = Math.random() * 100000.0;

    public void destroy() {
    }

    public void doFilter(ServletRequest request, ServletResponse response,
                         FilterChain chain) throws IOException, ServletException {
        HttpServletRequest req = (HttpServletRequest) request;
        HttpSession session = req.getSession();
        MDC.put("name", "元气");
        MDC.put("password", "123456");
        chain.doFilter(request, response);


    }

    public void init(FilterConfig Config) throws ServletException {
//     this.filterConfig = Config;  
//     String ccc = Config.getServletContext().getInitParameter("cherset");  
//     this.targetEncoding = Config.getInitParameter("cherset");  

    }
}  